Skip to content

Commit

Permalink
add \n
Browse files Browse the repository at this point in the history
  • Loading branch information
FullteaR committed Oct 29, 2023
1 parent dfb2851 commit e60d95a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Modules/_io/bytesio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ bytesiobuf_getbuffer(bytesiobuf *obj, Py_buffer *view, int flags)
PyBytes_AS_STRING(b->buf), b->string_size,
0, flags);
b->exports++;
printf("b->exports++ in bytesiobuf_getbuffer(bytesio.c) called");
printf("b->exports++ in bytesiobuf_getbuffer(bytesio.c) called\n");
return 0;
}

Expand All @@ -1104,7 +1104,7 @@ bytesiobuf_releasebuffer(bytesiobuf *obj, Py_buffer *view)
{
bytesio *b = (bytesio *) obj->source;
b->exports--;
printf("b->exports-- in bytesiobuf_releasebuffer(bytesio.c) called");
printf("b->exports-- in bytesiobuf_releasebuffer(bytesio.c) called\n");
}

static int
Expand Down
13 changes: 10 additions & 3 deletions Modules/mmapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdio.h>
#include "pycore_bytesobject.h" // _PyBytes_Find()
#include "pycore_fileutils.h" // _Py_stat_struct
#include "structmember.h" // PyMemberDef
#include <stddef.h> // offsetof()
#ifndef MS_WINDOWS
# include <unistd.h> // close()
#endif
#include <stdio.h>

// to support MS_WINDOWS_SYSTEM OpenFileMappingA / CreateFileMappingA
// need to be replaced with OpenFileMappingW / CreateFileMappingW
#if !defined(MS_WINDOWS) || defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_GAMES)

#ifndef MS_WINDOWS
#define UNIX
Expand Down Expand Up @@ -941,15 +948,15 @@ mmap_buffer_getbuf(mmap_object *self, Py_buffer *view, int flags)
(self->access == ACCESS_READ), flags) < 0)
return -1;
self->exports++;
printf("self->exports++ in mmap_buffer_getbuf(mmapmodule.c) called");
printf("self->exports++ in mmap_buffer_getbuf(mmapmodule.c) called\n");
return 0;
}

static void
mmap_buffer_releasebuf(mmap_object *self, Py_buffer *view)
{
self->exports--;
printf("self->exports-- in mmap_buffer_releasebuf(mmapmodule.c) called");
printf("self->exports-- in mmap_buffer_releasebuf(mmapmodule.c) called\n");
}

static Py_ssize_t
Expand Down
8 changes: 4 additions & 4 deletions Objects/memoryobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ mbuf_add_view(_PyManagedBufferObject *mbuf, const Py_buffer *src)
mv->mbuf = mbuf;
Py_INCREF(mbuf);
mbuf->exports++;
printf("mbuf->exports++ in mbuf_add_view(memoryobject.c) called");
printf("mbuf->exports++ in mbuf_add_view(memoryobject.c) called\n");

return (PyObject *)mv;
}
Expand Down Expand Up @@ -718,7 +718,7 @@ mbuf_add_incomplete_view(_PyManagedBufferObject *mbuf, const Py_buffer *src,
mv->mbuf = mbuf;
Py_INCREF(mbuf);
mbuf->exports++;
printf("mbuf->exports++ in mbuf_add_incomplete_view(memoryobject.c) called");
printf("mbuf->exports++ in mbuf_add_incomplete_view(memoryobject.c) called\n");

return (PyObject *)mv;
}
Expand Down Expand Up @@ -1519,15 +1519,15 @@ memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
view->obj = (PyObject *)self;
Py_INCREF(view->obj);
self->exports++;
printf("self->exports++ in memory_getbuf(memoryobject.c) called");
printf("self->exports++ in memory_getbuf(memoryobject.c) called\n");
return 0;
}

static void
memory_releasebuf(PyMemoryViewObject *self, Py_buffer *view)
{
self->exports--;
printf("self->exports-- in memory_releasebuf(memoryobject.c) called");
printf( "self->exports-- in memory_releasebuf(memoryobject.c) called\n");
return;
/* PyBuffer_Release() decrements view->obj after this function returns. */
}
Expand Down

0 comments on commit e60d95a

Please sign in to comment.