• Home
  • Raw
  • Download

Lines Matching refs:m_obj

117 mmap_object_dealloc(mmap_object *m_obj)  in mmap_object_dealloc()  argument
120 if (m_obj->data != NULL) in mmap_object_dealloc()
121 UnmapViewOfFile (m_obj->data); in mmap_object_dealloc()
122 if (m_obj->map_handle != NULL) in mmap_object_dealloc()
123 CloseHandle (m_obj->map_handle); in mmap_object_dealloc()
124 if (m_obj->file_handle != INVALID_HANDLE_VALUE) in mmap_object_dealloc()
125 CloseHandle (m_obj->file_handle); in mmap_object_dealloc()
126 if (m_obj->tagname) in mmap_object_dealloc()
127 PyMem_Free(m_obj->tagname); in mmap_object_dealloc()
131 if (m_obj->fd >= 0) in mmap_object_dealloc()
132 (void) close(m_obj->fd); in mmap_object_dealloc()
133 if (m_obj->data!=NULL) { in mmap_object_dealloc()
134 if (m_obj->access != ACCESS_READ && m_obj->access != ACCESS_COPY) in mmap_object_dealloc()
135 msync(m_obj->data, m_obj->size, MS_SYNC); in mmap_object_dealloc()
136 munmap(m_obj->data, m_obj->size); in mmap_object_dealloc()
140 Py_TYPE(m_obj)->tp_free((PyObject*)m_obj); in mmap_object_dealloc()
1102 mmap_object *m_obj; in new_mmap_object() local
1199 m_obj = (mmap_object *)type->tp_alloc(type, 0); in new_mmap_object()
1200 if (m_obj == NULL) {return NULL;} in new_mmap_object()
1201 m_obj->data = NULL; in new_mmap_object()
1202 m_obj->size = map_size; in new_mmap_object()
1203 m_obj->pos = 0; in new_mmap_object()
1204 m_obj->offset = offset; in new_mmap_object()
1206 m_obj->fd = -1; in new_mmap_object()
1218 Py_DECREF(m_obj); in new_mmap_object()
1224 m_obj->fd = dup(fd); in new_mmap_object()
1225 if (m_obj->fd == -1) { in new_mmap_object()
1226 Py_DECREF(m_obj); in new_mmap_object()
1232 m_obj->data = mmap(NULL, map_size, in new_mmap_object()
1240 if (m_obj->data == (char *)-1) { in new_mmap_object()
1241 m_obj->data = NULL; in new_mmap_object()
1242 Py_DECREF(m_obj); in new_mmap_object()
1246 m_obj->access = (access_mode)access; in new_mmap_object()
1247 return (PyObject *)m_obj; in new_mmap_object()
1261 mmap_object *m_obj; in new_mmap_object() local
1336 m_obj = (mmap_object *)type->tp_alloc(type, 0); in new_mmap_object()
1337 if (m_obj == NULL) in new_mmap_object()
1341 m_obj->data = NULL; in new_mmap_object()
1342 m_obj->file_handle = INVALID_HANDLE_VALUE; in new_mmap_object()
1343 m_obj->map_handle = NULL; in new_mmap_object()
1344 m_obj->tagname = NULL; in new_mmap_object()
1345 m_obj->offset = offset; in new_mmap_object()
1354 (LPHANDLE)&m_obj->file_handle, /* result */ in new_mmap_object()
1359 Py_DECREF(m_obj); in new_mmap_object()
1370 Py_DECREF(m_obj); in new_mmap_object()
1378 Py_DECREF(m_obj); in new_mmap_object()
1384 Py_DECREF(m_obj); in new_mmap_object()
1390 Py_DECREF(m_obj); in new_mmap_object()
1393 m_obj->size = (Py_ssize_t) (size - offset); in new_mmap_object()
1395 m_obj->size = map_size; in new_mmap_object()
1400 m_obj->size = map_size; in new_mmap_object()
1405 m_obj->pos = (size_t) 0; in new_mmap_object()
1409 m_obj->tagname = PyMem_Malloc(strlen(tagname)+1); in new_mmap_object()
1410 if (m_obj->tagname == NULL) { in new_mmap_object()
1412 Py_DECREF(m_obj); in new_mmap_object()
1415 strcpy(m_obj->tagname, tagname); in new_mmap_object()
1418 m_obj->tagname = NULL; in new_mmap_object()
1420 m_obj->access = (access_mode)access; in new_mmap_object()
1427 m_obj->map_handle = CreateFileMapping(m_obj->file_handle, in new_mmap_object()
1432 m_obj->tagname); in new_mmap_object()
1433 if (m_obj->map_handle != NULL) { in new_mmap_object()
1434 m_obj->data = (char *) MapViewOfFile(m_obj->map_handle, in new_mmap_object()
1438 m_obj->size); in new_mmap_object()
1439 if (m_obj->data != NULL) in new_mmap_object()
1440 return (PyObject *)m_obj; in new_mmap_object()
1443 CloseHandle(m_obj->map_handle); in new_mmap_object()
1444 m_obj->map_handle = NULL; in new_mmap_object()
1448 Py_DECREF(m_obj); in new_mmap_object()