Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(40416)

Delta Between Two Patch Sets: Modules/_uuidmodule.c

Issue 20519: ctypes.create_string_buffer creates reference cycles
Left Patch Set: Created 3 years, 11 months ago
Right Patch Set: Created 3 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/uuid.py ('k') | setup.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include "Python.h" 1 #include "Python.h"
2 #include <uuid/uuid.h> 2 #include <uuid/uuid.h>
3 3
4 static PyObject * 4 static PyObject *
5 _uuid_generate_random(void) 5 _uuid_generate_random(void)
6 { 6 {
7 uuid_t out; 7 uuid_t out;
8 uuid_generate_random(out); 8 uuid_generate_random(out);
9 return PyBytes_FromStringAndSize((const char *) out, sizeof(out)); 9 return PyBytes_FromStringAndSize((const char *) out, sizeof(out));
10 } 10 }
(...skipping 21 matching lines...) Expand all
32 -1, 32 -1,
33 uuid_methods, 33 uuid_methods,
34 NULL, 34 NULL,
35 NULL, 35 NULL,
36 NULL, 36 NULL,
37 NULL 37 NULL
38 }; 38 };
39 39
40 PyMODINIT_FUNC 40 PyMODINIT_FUNC
41 PyInit__uuid(void) 41 PyInit__uuid(void)
42 { 42 {
haypo 2015/10/27 03:35:14 Can you please add: assert(sizeof(uuid_t) == 16);
gustavo 2015/10/28 14:33:01 Added assert. Module still imports, as expected.
43 assert(sizeof(uuid_t) == 16);
43 return PyModule_Create(&uuidmodule); 44 return PyModule_Create(&uuidmodule);
44 } 45 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+