Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
9978520a
Commit
9978520a
authored
Jul 02, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use better allocation functions.
parent
18d18583
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
research/miniaudio_engine.h
research/miniaudio_engine.h
+8
-8
No files found.
research/miniaudio_engine.h
View file @
9978520a
...
...
@@ -8541,8 +8541,8 @@ static ma_result ma_resource_manager_data_stream_init_internal(ma_resource_manag
ma_resource_manager_inline_notification_uninit
(
&
waitNotification
);
}
ma_
_free_from_callbacks
(
pFilePathCopy
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
ma_
_free_from_callbacks
(
pFilePathWCopy
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
ma_
free
(
pFilePathCopy
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
ma_
free
(
pFilePathWCopy
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
return
result
;
}
...
...
@@ -9716,7 +9716,7 @@ static ma_result ma_resource_manager_process_job__load_data_stream(ma_resource_m
/* We have the decoder so we can now initialize our page buffer. */
pageBufferSizeInBytes
=
ma_resource_manager_data_stream_get_page_size_in_frames
(
pDataStream
)
*
2
*
ma_get_bytes_per_frame
(
pDataStream
->
decoder
.
outputFormat
,
pDataStream
->
decoder
.
outputChannels
);
pDataStream
->
pPageData
=
ma_
_malloc_from_callbacks
(
pageBufferSizeInBytes
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_DECODED_BUFFER*/
);
pDataStream
->
pPageData
=
ma_
malloc
(
pageBufferSizeInBytes
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_DECODED_BUFFER*/
);
if
(
pDataStream
->
pPageData
==
NULL
)
{
ma_decoder_uninit
(
&
pDataStream
->
decoder
);
result
=
MA_OUT_OF_MEMORY
;
...
...
@@ -9730,8 +9730,8 @@ static ma_result ma_resource_manager_process_job__load_data_stream(ma_resource_m
result
=
MA_SUCCESS
;
done:
ma_
_free_from_callbacks
(
pJob
->
loadDataStream
.
pFilePath
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
ma_
_free_from_callbacks
(
pJob
->
loadDataStream
.
pFilePathW
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
ma_
free
(
pJob
->
loadDataStream
.
pFilePath
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
ma_
free
(
pJob
->
loadDataStream
.
pFilePathW
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_TRANSIENT_STRING*/
);
/* We can only change the status away from MA_BUSY. If it's set to anything else it means an error has occurred somewhere or the uninitialization process has started (most likely). */
c89atomic_compare_and_swap_32
(
&
pDataStream
->
result
,
MA_BUSY
,
result
);
...
...
@@ -9770,7 +9770,7 @@ static ma_result ma_resource_manager_process_job__free_data_stream(ma_resource_m
}
if
(
pDataStream
->
pPageData
!=
NULL
)
{
ma_
_free_from_callbacks
(
pDataStream
->
pPageData
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_DECODED_BUFFER*/
);
ma_
free
(
pDataStream
->
pPageData
,
&
pResourceManager
->
config
.
allocationCallbacks
/*, MA_ALLOCATION_TYPE_DECODED_BUFFER*/
);
pDataStream
->
pPageData
=
NULL
;
/* Just in case... */
}
...
...
@@ -12022,7 +12022,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
if
(
pEngine
->
pDevice
==
NULL
)
{
ma_device_config
deviceConfig
;
pEngine
->
pDevice
=
(
ma_device
*
)
ma_
_malloc_from_callbacks
(
sizeof
(
*
pEngine
->
pDevice
),
&
pEngine
->
allocationCallbacks
/*, MA_ALLOCATION_TYPE_CONTEXT*/
);
pEngine
->
pDevice
=
(
ma_device
*
)
ma_
malloc
(
sizeof
(
*
pEngine
->
pDevice
),
&
pEngine
->
allocationCallbacks
/*, MA_ALLOCATION_TYPE_CONTEXT*/
);
if
(
pEngine
->
pDevice
==
NULL
)
{
return
MA_OUT_OF_MEMORY
;
}
...
...
@@ -12059,7 +12059,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
}
if
(
result
!=
MA_SUCCESS
)
{
ma_
_free_from_callbacks
(
pEngine
->
pDevice
,
&
pEngine
->
allocationCallbacks
/*, MA_ALLOCATION_TYPE_CONTEXT*/
);
ma_
free
(
pEngine
->
pDevice
,
&
pEngine
->
allocationCallbacks
/*, MA_ALLOCATION_TYPE_CONTEXT*/
);
pEngine
->
pDevice
=
NULL
;
return
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment