Lines Matching refs:m_obj
118 mmap_object_dealloc(mmap_object *m_obj) in mmap_object_dealloc() argument
122 if (m_obj->data != NULL) in mmap_object_dealloc()
123 UnmapViewOfFile (m_obj->data); in mmap_object_dealloc()
124 if (m_obj->map_handle != NULL) in mmap_object_dealloc()
125 CloseHandle (m_obj->map_handle); in mmap_object_dealloc()
126 if (m_obj->file_handle != INVALID_HANDLE_VALUE) in mmap_object_dealloc()
127 CloseHandle (m_obj->file_handle); in mmap_object_dealloc()
129 if (m_obj->tagname) in mmap_object_dealloc()
130 PyMem_Free(m_obj->tagname); in mmap_object_dealloc()
135 if (m_obj->fd >= 0) in mmap_object_dealloc()
136 (void) close(m_obj->fd); in mmap_object_dealloc()
137 if (m_obj->data!=NULL) { in mmap_object_dealloc()
138 munmap(m_obj->data, m_obj->size); in mmap_object_dealloc()
143 if (m_obj->weakreflist != NULL) in mmap_object_dealloc()
144 PyObject_ClearWeakRefs((PyObject *) m_obj); in mmap_object_dealloc()
145 Py_TYPE(m_obj)->tp_free((PyObject*)m_obj); in mmap_object_dealloc()
1142 mmap_object *m_obj; in new_mmap_object() local
1243 m_obj = (mmap_object *)type->tp_alloc(type, 0); in new_mmap_object()
1244 if (m_obj == NULL) {return NULL;} in new_mmap_object()
1245 m_obj->data = NULL; in new_mmap_object()
1246 m_obj->size = map_size; in new_mmap_object()
1247 m_obj->pos = 0; in new_mmap_object()
1248 m_obj->weakreflist = NULL; in new_mmap_object()
1249 m_obj->exports = 0; in new_mmap_object()
1250 m_obj->offset = offset; in new_mmap_object()
1252 m_obj->fd = -1; in new_mmap_object()
1271 Py_DECREF(m_obj); in new_mmap_object()
1277 m_obj->fd = _Py_dup(fd); in new_mmap_object()
1278 if (m_obj->fd == -1) { in new_mmap_object()
1279 Py_DECREF(m_obj); in new_mmap_object()
1284 m_obj->data = mmap(NULL, map_size, in new_mmap_object()
1292 if (m_obj->data == (char *)-1) { in new_mmap_object()
1293 m_obj->data = NULL; in new_mmap_object()
1294 Py_DECREF(m_obj); in new_mmap_object()
1298 m_obj->access = (access_mode)access; in new_mmap_object()
1299 return (PyObject *)m_obj; in new_mmap_object()
1313 mmap_object *m_obj; in new_mmap_object() local
1392 m_obj = (mmap_object *)type->tp_alloc(type, 0); in new_mmap_object()
1393 if (m_obj == NULL) in new_mmap_object()
1397 m_obj->data = NULL; in new_mmap_object()
1398 m_obj->file_handle = INVALID_HANDLE_VALUE; in new_mmap_object()
1399 m_obj->map_handle = NULL; in new_mmap_object()
1400 m_obj->tagname = NULL; in new_mmap_object()
1401 m_obj->offset = offset; in new_mmap_object()
1410 (LPHANDLE)&m_obj->file_handle, /* result */ in new_mmap_object()
1415 Py_DECREF(m_obj); in new_mmap_object()
1426 Py_DECREF(m_obj); in new_mmap_object()
1434 Py_DECREF(m_obj); in new_mmap_object()
1440 Py_DECREF(m_obj); in new_mmap_object()
1446 Py_DECREF(m_obj); in new_mmap_object()
1449 m_obj->size = (Py_ssize_t) (size - offset); in new_mmap_object()
1451 m_obj->size = map_size; in new_mmap_object()
1456 m_obj->size = map_size; in new_mmap_object()
1461 m_obj->pos = (size_t) 0; in new_mmap_object()
1463 m_obj->weakreflist = NULL; in new_mmap_object()
1464 m_obj->exports = 0; in new_mmap_object()
1467 m_obj->tagname = PyMem_Malloc(strlen(tagname)+1); in new_mmap_object()
1468 if (m_obj->tagname == NULL) { in new_mmap_object()
1470 Py_DECREF(m_obj); in new_mmap_object()
1473 strcpy(m_obj->tagname, tagname); in new_mmap_object()
1476 m_obj->tagname = NULL; in new_mmap_object()
1478 m_obj->access = (access_mode)access; in new_mmap_object()
1485 m_obj->map_handle = CreateFileMapping(m_obj->file_handle, in new_mmap_object()
1490 m_obj->tagname); in new_mmap_object()
1491 if (m_obj->map_handle != NULL) { in new_mmap_object()
1492 m_obj->data = (char *) MapViewOfFile(m_obj->map_handle, in new_mmap_object()
1496 m_obj->size); in new_mmap_object()
1497 if (m_obj->data != NULL) in new_mmap_object()
1498 return (PyObject *)m_obj; in new_mmap_object()
1501 CloseHandle(m_obj->map_handle); in new_mmap_object()
1502 m_obj->map_handle = NULL; in new_mmap_object()
1506 Py_DECREF(m_obj); in new_mmap_object()