[Python-checkins] r50594 - in python/branches/bcannon-sandboxing: Include/sandbox.h Python/sandbox.c

brett.cannon python-checkins at python.org
Wed Jul 12 00:41:07 CEST 2006


Author: brett.cannon
Date: Wed Jul 12 00:41:07 2006
New Revision: 50594

Modified:
   python/branches/bcannon-sandboxing/Include/sandbox.h
   python/branches/bcannon-sandboxing/Python/sandbox.c
Log:
More size_t converting.


Modified: python/branches/bcannon-sandboxing/Include/sandbox.h
==============================================================================
--- python/branches/bcannon-sandboxing/Include/sandbox.h	(original)
+++ python/branches/bcannon-sandboxing/Include/sandbox.h	Wed Jul 12 00:41:07 2006
@@ -31,15 +31,15 @@
    Memory
 */
 
-PyAPI_FUNC(int) PySandbox_SetMemoryCap(PyThreadState *, Py_ssize_t);
+PyAPI_FUNC(int) PySandbox_SetMemoryCap(PyThreadState *, size_t);
 
-PyAPI_FUNC(int) _PySandbox_AllowedMemoryAlloc(Py_ssize_t);
+PyAPI_FUNC(int) _PySandbox_AllowedMemoryAlloc(size_t);
 /* Return for caller if memory allocation would exceed memory cap. */
 #define PySandbox_AllowedMemoryAlloc(alloc, err_return) \
     if (!_PySandbox_AllowedMemoryAlloc(alloc)) return err_return
 
 /* Lower memory usage. */
-PyAPI_FUNC(void) PySandbox_AllowedMemoryFree(Py_ssize_t);
+PyAPI_FUNC(void) PySandbox_AllowedMemoryFree(size_t);
 
 #ifdef __cplusplus
 }

Modified: python/branches/bcannon-sandboxing/Python/sandbox.c
==============================================================================
--- python/branches/bcannon-sandboxing/Python/sandbox.c	(original)
+++ python/branches/bcannon-sandboxing/Python/sandbox.c	Wed Jul 12 00:41:07 2006
@@ -10,7 +10,7 @@
    Set the memory cap for a sandboxed interpreter.
 */
 int
-PySandbox_SetMemoryCap(PyThreadState *s_tstate, Py_ssize_t mem_cap)
+PySandbox_SetMemoryCap(PyThreadState *s_tstate, size_t mem_cap)
 {
     PySandboxState *sandbox_state = s_tstate->interp->sandbox_state;
 
@@ -26,7 +26,7 @@
    Verify that memory allocation is allowed.
 */
 int
-_PySandbox_AllowedMemoryAlloc(Py_ssize_t allocate)
+_PySandbox_AllowedMemoryAlloc(size_t allocate)
 {
     PySandboxState *sandbox_state = NULL;
 
@@ -56,7 +56,7 @@
    Verify that freeing memory does not go past what was already used.
 */
 void
-PySandbox_AllowedMemoryFree(Py_ssize_t deallocate)
+PySandbox_AllowedMemoryFree(size_t deallocate)
 {
     PySandboxState *sandbox_state = NULL;
 


More information about the Python-checkins mailing list