Repository navigation
Expand file tree
/
Copy pathmemory.html
More file actions
2142 lines (1803 loc) · 171 KB
/
Copy pathmemory.html
File metadata and controls
2142 lines (1803 loc) · 171 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" data-content_root="../" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Memory Management Infrastructure API — SOF Project 2.11.0 documentation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!--
this give us a css class that will be invisible only if js is disabled
-->
<noscript>
<style>
.pst-js-only { display: none !important; }
</style>
</noscript>
<!-- Loaded before other Sphinx assets -->
<link href="../_static/styles/theme.css?digest=cb8930eaaf36d9849b67" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=cb8930eaaf36d9849b67" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=4ae1632d" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/sof-custom.css?v=e5d98f1e" />
<!-- So that users can add custom icons -->
<script defer src="../_static/scripts/fontawesome.js?digest=cb8930eaaf36d9849b67"></script>
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=cb8930eaaf36d9849b67" />
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=cb8930eaaf36d9849b67" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=1647406f"></script>
<script src="../_static/doctools.js?v=fd6eb6e6"></script>
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=450e7cbd"></script>
<script src="../_static/sof-custom.js?v=bf19b57e"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'api/memory';</script>
<script>DOCUMENTATION_OPTIONS.search_as_you_type = false;</script>
<link rel="icon" href="../_static/sof-favicon.svg"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Scheduling Infrastructure API" href="scheduling.html" />
<link rel="prev" title="Audio Formats & Channel Routing API" href="audio_format.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="latest" />
<meta name="docbuild:last-update" content="Oct 27, 2026"/>
<script src="../_static/searchtools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../searchindex.js"></script>
</head>
<body data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<dialog id="pst-search-dialog">
<form class="bd-search d-flex align-items-center"
action="../search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
placeholder="Search the docs ..."
aria-label="Search the docs ..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form>
</dialog>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header id="pst-header" class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
<div class="bd-header__inner bd-page-width">
<button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="Site navigation">
<span class="fa-solid fa-bars"></span>
</button>
<div class="col-lg-3 navbar-header-items__start">
<div class="navbar-item">
<a class="navbar-brand logo" href="../introduction/index.html">
<img src="../_static/logo_sof_white_200w.png" class="logo__image only-light" alt="SOF Project 2.11.0 documentation - Home"/>
<img src="../_static/logo_sof_white_200w.png" class="logo__image only-dark pst-js-only" alt="SOF Project 2.11.0 documentation - Home"/>
</a></div>
</div>
<div class="col-lg-9 navbar-header-items">
<div class="me-auto navbar-header-items__center">
<div class="navbar-item">
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-external" href="https://sofproject.org">
SOF Project Website
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../introduction/index.html">
Introduction to the SOF Project
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../getting_started/index.html">
Getting Started Guides
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../architectures/index.html">
Architecture & System Design
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../platforms/index.html">
Platforms
</a>
</li>
<li class="nav-item dropdown">
<button class="btn dropdown-toggle nav-item" type="button"
data-bs-toggle="dropdown" aria-expanded="false"
aria-controls="pst-nav-more-links">
More
</button>
<ul id="pst-nav-more-links" class="dropdown-menu">
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../algos/index.html">
Algorithms
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../developer_guides/index.html">
Developer Guides
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../release.html">
Firmware Binary Releases
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../contribute/index.html">
Contributing to the Project
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../tsc/index.html">
Technical Steering Committee (TSC)
</a>
</li>
<li class=" current active">
<a class="nav-link dropdown-item nav-internal" href="index.html">
API Documentation
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../presentations/index.html">
Presentations
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-internal" href="../faq/index.html">
Frequently Asked Questions (FAQ)
</a>
</li>
<li class=" ">
<a class="nav-link dropdown-item nav-external" href="https://sofproject.org">
SOF Project Website
</a>
</li>
</ul>
</li>
</ul>
</nav></div>
</div>
<div class="navbar-header-items__end">
<div class="navbar-item navbar-persistent--container">
<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
</div>
<div class="navbar-item">
<div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode">
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown">
<i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="Light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="Dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li>
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>Light</button></li>
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>Dark</button></li>
</ul>
</div></div>
<div class="navbar-item"><ul class="navbar-icon-links"
aria-label="Icon Links">
<li class="nav-item">
<a href="https://github.com/thesofproject/sof" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a>
</li>
</ul></div>
</div>
</div>
<div class="navbar-persistent--mobile">
<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
</div>
<button class="pst-navbar-icon sidebar-toggle secondary-toggle" aria-label="On this page">
<span class="fa-solid fa-outdent"></span>
</button>
</div>
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<dialog id="pst-primary-sidebar-modal"></dialog>
<div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
<div class="sidebar-header-items__center">
<div class="navbar-item">
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item ">
<a class="nav-link nav-external" href="https://sofproject.org">
SOF Project Website
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../introduction/index.html">
Introduction to the SOF Project
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../getting_started/index.html">
Getting Started Guides
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../architectures/index.html">
Architecture & System Design
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../platforms/index.html">
Platforms
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../algos/index.html">
Algorithms
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../developer_guides/index.html">
Developer Guides
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../release.html">
Firmware Binary Releases
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../contribute/index.html">
Contributing to the Project
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../tsc/index.html">
Technical Steering Committee (TSC)
</a>
</li>
<li class="nav-item current active">
<a class="nav-link nav-internal" href="index.html">
API Documentation
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../presentations/index.html">
Presentations
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-internal" href="../faq/index.html">
Frequently Asked Questions (FAQ)
</a>
</li>
<li class="nav-item ">
<a class="nav-link nav-external" href="https://sofproject.org">
SOF Project Website
</a>
</li>
</ul>
</nav></div>
</div>
<div class="sidebar-header-items__end">
<div class="navbar-item">
<div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode">
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown">
<i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="Light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="Dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li>
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>Light</button></li>
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>Dark</button></li>
</ul>
</div></div>
<div class="navbar-item"><ul class="navbar-icon-links"
aria-label="Icon Links">
<li class="nav-item">
<a href="https://github.com/thesofproject/sof" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a>
</li>
</ul></div>
</div>
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item pst-sidebar-collapse"><button id="pst-collapse-sidebar-button" aria-expanded="true" aria-controls="pst-primary-sidebar">
<svg class="pst-icon" role="img" aria-hidden="true" focusable="false" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path fill="currentColor" d="M3 15.5C2.36232 15.5 1.74874 15.2564 1.28478 14.8189C0.820828 14.3815 0.541576 13.7832 0.504167 13.1467L0.5 13L0.5 3C0.499965 2.36232 0.743605 1.74874 1.18107 1.28478C1.61854 0.820828 2.21676 0.541576 2.85333 0.504167L3 0.5L13 0.5C13.6377 0.499965 14.2513 0.743605 14.7152 1.18107C15.1792 1.61854 15.4584 2.21676 15.4958 2.85333L15.5 3L15.5 13C15.5 13.6377 15.2564 14.2513 14.8189 14.7152C14.3815 15.1792 13.7832 15.4584 13.1467 15.4958L13 15.5L3 15.5ZM3 13.8333L10.5 13.8333L10.5 2.16667L3 2.16667C2.79589 2.16669 2.59889 2.24163 2.44636 2.37726C2.29383 2.5129 2.19638 2.69979 2.1725 2.9025L2.16667 3L2.16667 13C2.16669 13.2041 2.24163 13.4011 2.37726 13.5536C2.5129 13.7062 2.69979 13.8036 2.9025 13.8275L3 13.8333ZM6.65583 10.325L6.5775 10.2558L4.91083 8.58917C4.76735 8.44567 4.68116 8.25476 4.66843 8.05223C4.65569 7.84971 4.71729 7.6495 4.84167 7.48917L4.91083 7.41083L6.5775 5.74417C6.72747 5.59471 6.9287 5.50794 7.14032 5.50148C7.35194 5.49502 7.55809 5.56935 7.7169 5.70937C7.8757 5.8494 7.97525 6.04463 7.99533 6.25539C8.01541 6.46616 7.95451 6.67667 7.825 6.84417L7.75583 6.9225L6.67917 8L7.75583 9.0775C7.89931 9.22099 7.98551 9.41191 7.99824 9.61443C8.01097 9.81695 7.94938 10.0172 7.825 10.1775L7.75583 10.2558C7.61234 10.3993 7.42142 10.4855 7.2189 10.4982C7.01638 10.511 6.81617 10.4494 6.65583 10.325Z"/>
</svg>
<span class="pst-collapse-sidebar-label">Collapse Sidebar</span>
<span class="pst-expand-sidebar-label">Expand Sidebar</span>
</button></div>
<div class="sidebar-primary-item">
<nav class="bd-docs-nav bd-links"
aria-label="Section Navigation">
<p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p>
<div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="ipc4.html">IPC4 Host-DSP Protocol API</a></li>
<li class="toctree-l1"><a class="reference internal" href="components.html">Audio Processing Components & Modules API</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="pipeline.html">Audio Pipeline Infrastructure API</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="pipeline_graph.html">Pipeline Graph & Lifecycle API</a></li>
<li class="toctree-l2"><a class="reference internal" href="component_infra.html">Audio Component Infrastructure API</a></li>
<li class="toctree-l2"><a class="reference internal" href="audio_buffer.html">Audio Buffer & Stream Management API</a></li>
<li class="toctree-l2"><a class="reference internal" href="audio_format.html">Audio Formats & Channel Routing API</a></li>
</ul>
</details></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Memory Management Infrastructure API</a></li>
<li class="toctree-l1"><a class="reference internal" href="scheduling.html">Scheduling Infrastructure API</a></li>
<li class="toctree-l1"><a class="reference internal" href="rtos.html">RTOS Abstraction Layer API</a></li>
<li class="toctree-l1"><a class="reference internal" href="math.html">DSP Math & Filter Libraries API</a></li>
<li class="toctree-l1"><a class="reference internal" href="telemetry.html">Telemetry, Logging & Probes API</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
<div class="sidebar-primary-item">
<div id="ethical-ad-placement"
class="flat"
data-ea-publisher="readthedocs"
data-ea-type="readthedocs-sidebar"
data-ea-manual="true">
</div></div>
</div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item">
<nav aria-label="Breadcrumb" class="d-print-none">
<ul class="bd-breadcrumbs">
<li class="breadcrumb-item breadcrumb-home">
<a href="../index.html" class="nav-link" aria-label="Home">
<i class="fa-solid fa-home"></i>
</a>
</li>
<li class="breadcrumb-item"><a href="index.html" class="nav-link">API Documentation</a></li>
<li class="breadcrumb-item active" aria-current="page"><span class="ellipsis">Memory Management Infrastructure API</span></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<section id="memory-management-infrastructure-api">
<span id="api-memory"></span><h1>Memory Management Infrastructure API<a class="headerlink" href="#memory-management-infrastructure-api" title="Link to this heading">#</a></h1>
<p>The Sound Open Firmware (SOF) memory architecture is organized into a multi-tier
subsystem engineered for low-latency DSP audio pipelines, fine-grained power management,
dynamic loadable module isolation, and flexible physical-to-virtual memory mapping.</p>
<section id="memory-architecture-organization">
<h2>Memory Architecture Organization<a class="headerlink" href="#memory-architecture-organization" title="Link to this heading">#</a></h2>
<p>SOF firmware executes across DSP architectures with heterogeneous memory pools
and dedicated cache hierarchies:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>+-------------------------------------------------------------------------+
| Audio Processing Modules (LLEXT) |
| mod_balloc_align() / mod_alloc_ext() / mod_alloc() |
+------------------------------------+------------------------------------+
|
+------------------------------------v------------------------------------+
| Context & Virtual Region Allocator (vregion) |
| struct mod_alloc_ctx { heap, vregion } |
| [ Lifetime Partition ] <---> [ Interim Partition ] |
+------------------------------------+------------------------------------+
|
+------------------------------------v------------------------------------+
| Core RTOS Memory Allocators |
| rmalloc_align() / rmalloc() / rzalloc() / rfree() |
| rballoc_align() / rballoc() |
+-----------------+------------------+------------------+-----------------+
| | |
+-----------------v----+ +---------v----------+ +---v-----------------+
| System & Shared Heap | | Virtual Heap (VMH) | | L3 IMR / DRAM Heap |
| - sof_heap (SRAM) | | - Dynamic TLB | | - External DRAM |
| - shared_buffer_heap| | - vpage_alloc() | | - Cached only |
| - Syscall k_heap | | - Power-of-2 bins | | - l3_heap_save() |
+----------------------+ +--------------------+ +---------------------+
</pre></div>
</div>
<section id="physical-virtual-address-spaces">
<h3>Physical & Virtual Address Spaces<a class="headerlink" href="#physical-virtual-address-spaces" title="Link to this heading">#</a></h3>
<ol class="arabic simple">
<li><p><strong>High-Speed Internal SRAM (L2 SRAM)</strong>:
Low-latency on-chip memory where time-critical Low Latency (LL) task code,
stack frames, ring buffers, and active processing states reside.</p></li>
<li><p><strong>Cached vs. Uncached (Coherent) Memory Windows</strong>:
On architectures like Xtensa and Intel cAVS/ACE, physical SRAM is mapped into
both cached and uncached address aliases. The allocator dynamically selects the
appropriate pointer representation based on <code class="docutils literal notranslate"><span class="pre">SOF_MEM_FLAG_COHERENT</span></code>:</p>
<ul class="simple">
<li><p><strong>Cached addresses</strong>: Default for algorithm compute loops to maximize L1 cache throughput.</p></li>
<li><p><strong>Uncached (coherent) addresses</strong>: Required for DMA ring buffer descriptors, host mailboxes,
and multi-core shared IPC control blocks.</p></li>
</ul>
</li>
<li><p><strong>External DRAM / Isolated Memory Region (L3 / IMR)</strong>:
High-capacity DRAM backing storage used on Intel ACE platforms (e.g. MTL, ARL, LNL, PTL)
for storing large coefficient blobs, deep buffers, and inactive LLEXT modules.
L3 allocations are strictly cached; requesting coherent L3 memory returns <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.
<code class="docutils literal notranslate"><span class="pre">l3_heap_save()</span></code> preserves L3 state and flushes cache lines across DSP power gating.</p></li>
<li><p><strong>Shared User/Kernel Memory Heap</strong>:
When <code class="docutils literal notranslate"><span class="pre">CONFIG_SOF_USERSPACE_USE_SHARED_HEAP</span></code> is active, a dedicated
<code class="docutils literal notranslate"><span class="pre">shared_buffer_heap</span></code> is mapped across user space and supervisor domains
for zero-copy buffer transfer between user modules and kernel drivers.</p></li>
</ol>
</section>
<section id="subsystem-hierarchy-allocators">
<h3>Subsystem Hierarchy & Allocators<a class="headerlink" href="#subsystem-hierarchy-allocators" title="Link to this heading">#</a></h3>
<ul class="simple">
<li><p><strong>Core Allocators (``rmalloc_align``, ``rmalloc``, ``rzalloc``, ``rfree``)</strong>:
General-purpose RTOS allocators evaluating flags (<code class="docutils literal notranslate"><span class="pre">SOF_MEM_FLAG_*</span></code>) to select
between <code class="docutils literal notranslate"><span class="pre">l3_heap</span></code>, <code class="docutils literal notranslate"><span class="pre">shared_buffer_heap</span></code>, and <code class="docutils literal notranslate"><span class="pre">sof_heap</span></code>, with automatic
VMH fallback on exhaustion.</p></li>
<li><p><strong>Audio Streaming Buffer Allocator (``rballoc_align``, ``rballoc``)</strong>:
Specialized runtime buffer allocator for PCM streams. Unlike <code class="docutils literal notranslate"><span class="pre">rmalloc_align()</span></code>,
<code class="docutils literal notranslate"><span class="pre">rballoc_align()</span></code> actively prioritizes the Virtual Memory Heap (VMH) when available
to preserve scarce internal SRAM.</p></li>
<li><p><strong>Context-Based Allocations (``struct mod_alloc_ctx``, ``sof_ctx_*``)</strong>:
Pairs a Zephyr <code class="docutils literal notranslate"><span class="pre">k_heap</span></code> with an optional <code class="docutils literal notranslate"><span class="pre">vregion</span></code>. Allocations are automatically
directed to the vregion interim partition when present, and fall back to <code class="docutils literal notranslate"><span class="pre">sof_heap_alloc()</span></code>.</p></li>
<li><p><strong>Contiguous Virtual Regions (``vregion``)</strong>:
Manages a pre-allocated contiguous address range partitioned into <strong>Lifetime</strong>
(non-freeable pipeline topology allocations) and <strong>Interim</strong> (dynamically freed
runtime parameter buffers and control payloads) segments.</p></li>
<li><p><strong>Virtual Page Allocator (``vpage``) & Multi-Bundle VMH</strong>:
Provides dynamic TLB page-table mapping (<code class="docutils literal notranslate"><span class="pre">vpage_alloc</span></code> / <code class="docutils literal notranslate"><span class="pre">vpage_free</span></code>) and
power-of-2 block bundle management (<code class="docutils literal notranslate"><span class="pre">vmh_init_heap</span></code>, <code class="docutils literal notranslate"><span class="pre">vmh_alloc</span></code>, <code class="docutils literal notranslate"><span class="pre">vmh_free</span></code>).</p></li>
<li><p><strong>Cold DRAM Dynamic Staging (``fast_get`` / ``fast_put``)</strong>:
Enables code or read-only constants stored in cold DRAM to be temporarily staged
into high-speed SRAM during processing execution, then released back.</p></li>
<li><p><strong>Cold Path Annotations & Safety Invariants</strong>:
Functions annotated with <code class="docutils literal notranslate"><span class="pre">__cold</span></code> and data with <code class="docutils literal notranslate"><span class="pre">__cold_rodata</span></code> may be placed
in offload storage. The runtime invariant <code class="docutils literal notranslate"><span class="pre">assert_can_be_cold()</span></code> validates that
non-latency-critical code is never invoked from a real-time Low Latency (LL) thread.</p></li>
</ul>
</section>
</section>
<section id="c-api-reference">
<h2>C API Reference<a class="headerlink" href="#c-api-reference" title="Link to this heading">#</a></h2>
<dl>
<dt class="sig sig-object cpp">
<span class="target" id="group__memory__api"></span><em><span class="pre">group</span></em> <span class="sig-name descname"><span class="pre">Memory</span> <span class="pre">Management</span> <span class="pre">Infrastructure</span></span></dt>
<dd><p>System heaps, Virtual Memory Heap (VMH), virtual regions, cold DRAM staging, and audio buffer allocators. </p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><strong>Re-entrancy Contract</strong>: This API is <strong>NOT re-entrant</strong>. While runtime allocation and deallocation operations (<a class="reference internal" href="#group__memory__api_1ga9ba1c0e48f90d1554a5d6a2d277705e6"><span class="std std-ref">vmh_alloc()</span></a>, <a class="reference internal" href="#group__memory__api_1gae1bb69059f674513326ffeea9a2bdee0"><span class="std std-ref">vmh_free()</span></a>) synchronize internally via the heap mutex, heap lifecycle management operations (such as <a class="reference internal" href="#group__memory__api_1ga7433e2fdda85f94fd9c6f53bf83c509d"><span class="std std-ref">vmh_free_heap()</span></a>) do not use mutual exclusion. It is assumed that only system management code performs heap lifecycle operations, and concurrent heap management with runtime allocations must be avoided. </p>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-allocation-flags">Allocation flags</p>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_DMA">
<span class="target" id="group__memory__api_1gadc789c89b87913278a1c1770edd92039"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_DMA</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_DMA" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate memory accessible by DMA controllers (e.g. </p>
<p>Host or DSP DMA). </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_NO_COPY">
<span class="target" id="group__memory__api_1ga9948b596753e3905aec14331fd9a44bc"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_NO_COPY</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_NO_COPY" title="Link to this definition">#</a><br /></dt>
<dd><p>realloc() skips copying the original content. </p>
<p><dl>
<dt class="sig sig-object cpp">
<em><span class="pre">Deprecated:</span></em></dt>
<dd><p>Legacy realloc optimization flag. rbrealloc() and rbrealloc_align() have been removed from the allocation API. </p>
</dd></dl>
</p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_COHERENT">
<span class="target" id="group__memory__api_1gada4f52850d9357cbcd7d96f28ffffa49"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_COHERENT</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_COHERENT" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate uncached / coherent memory address. </p>
<p>Directs the allocator to return an uncached pointer (e.g. bypassing cache alias or mapping uncached). Mandatory for DMA descriptors, mailboxes, and cross-core shared variables. Not supported for L3 memory. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_L3">
<span class="target" id="group__memory__api_1gafb9688284a347048467239fd721740d5"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_L3</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_L3" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate from L3 address space (IMR / external DRAM heap). </p>
<p>Allocates from the L3 heap (l3_heap). Only cached allocations are supported; requesting coherent L3 memory will fail and return NULL. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_LOW_POWER">
<span class="target" id="group__memory__api_1ga36ad273d869ebf38ea07bbed43927f29"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_LOW_POWER</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_LOW_POWER" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate Low power memory address. </p>
<p><dl>
<dt class="sig sig-object cpp">
<em><span class="pre">Deprecated:</span></em></dt>
<dd><p>Legacy flag from XTOS memory partitions; no-op in modern Zephyr heap manager. </p>
</dd></dl>
</p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_KERNEL">
<span class="target" id="group__memory__api_1ga8247e67b6ab60002fff02f197e04b924"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_KERNEL</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_KERNEL" title="Link to this definition">#</a><br /></dt>
<dd><p>Base allocation flag denoting memory allocated for kernel-space data structures. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_USER">
<span class="target" id="group__memory__api_1ga735064ecf00842d455a2e29ecbd03ae9"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_USER</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_USER" title="Link to this definition">#</a><br /></dt>
<dd><p>Base allocation flag denoting memory allocated for user-space threads and module execution. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_USER_SHARED_BUFFER">
<span class="target" id="group__memory__api_1ga00bb6f55a5bfbc97d98caf454b0d47bb"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_USER_SHARED_BUFFER</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_USER_SHARED_BUFFER" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate from shared user memory heap (shared_buffer_heap) accessible across user/kernel domains. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.SOF_MEM_FLAG_LARGE_BUFFER">
<span class="target" id="group__memory__api_1ga24dc1bfdfeca120357059f584afc6576"></span><span class="sig-name descname"><span class="n"><span class="pre">SOF_MEM_FLAG_LARGE_BUFFER</span></span></span><a class="headerlink" href="#c.SOF_MEM_FLAG_LARGE_BUFFER" title="Link to this definition">#</a><br /></dt>
<dd><p>Route allocation to the Virtual Memory Heap (VMH / virtual_buffers_heap) for large stream buffers. </p>
</dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-defines">Defines</p>
<dl class="c macro">
<dt class="sig sig-object c" id="c.__coherent">
<span class="target" id="group__memory__api_1gaef0d2853d6d1a17b18ed2c2166b978bb"></span><span class="sig-name descname"><span class="n"><span class="pre">__coherent</span></span></span><a class="headerlink" href="#c.__coherent" title="Link to this definition">#</a><br /></dt>
<dd><p>Cache line alignment specifier for coherent shared memory objects. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.ADDR_IS_INCOHERENT">
<span class="target" id="group__memory__api_1gaee74d7065a8e4c5320a379157611e341"></span><span class="sig-name descname"><span class="n"><span class="pre">ADDR_IS_INCOHERENT</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.ADDR_IS_INCOHERENT" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.ADDR_IS_COHERENT">
<span class="target" id="group__memory__api_1ga1b75d30ff15e76e24a81128361f190a2"></span><span class="sig-name descname"><span class="n"><span class="pre">ADDR_IS_COHERENT</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.ADDR_IS_COHERENT" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CORE_CHECK_STRUCT_FIELD">
<span class="target" id="group__memory__api_1gab1ce651b4ead515075a6609e6a02a699"></span><span class="sig-name descname"><span class="n"><span class="pre">CORE_CHECK_STRUCT_FIELD</span></span></span><a class="headerlink" href="#c.CORE_CHECK_STRUCT_FIELD" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CORE_CHECK_STRUCT_INIT">
<span class="target" id="group__memory__api_1gaeb2a08ff693669054c48504369bf607e"></span><span class="sig-name descname"><span class="n"><span class="pre">CORE_CHECK_STRUCT_INIT</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span>, <span class="n"><span class="pre">is_shared</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.CORE_CHECK_STRUCT_INIT" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CORE_CHECK_STRUCT">
<span class="target" id="group__memory__api_1ga220efb6f8c8acfc07a4daabd39759128"></span><span class="sig-name descname"><span class="n"><span class="pre">CORE_CHECK_STRUCT</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.CORE_CHECK_STRUCT" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CHECK_COHERENT_CORE">
<span class="target" id="group__memory__api_1ga30951b04f5b5ec8b9e2d76064a5f6249"></span><span class="sig-name descname"><span class="n"><span class="pre">CHECK_COHERENT_CORE</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.CHECK_COHERENT_CORE" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CHECK_ISR">
<span class="target" id="group__memory__api_1ga106508eb453108bfbcdb069700cc5513"></span><span class="sig-name descname"><span class="n"><span class="pre">CHECK_ISR</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.CHECK_ISR" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CHECK_SLEEP">
<span class="target" id="group__memory__api_1gacf84c80ec13c7977637ec8587168e770"></span><span class="sig-name descname"><span class="n"><span class="pre">CHECK_SLEEP</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.CHECK_SLEEP" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.CHECK_ATOMIC">
<span class="target" id="group__memory__api_1gafe2739a196c5b72339d562db819148c9"></span><span class="sig-name descname"><span class="n"><span class="pre">CHECK_ATOMIC</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">_c</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.CHECK_ATOMIC" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.coherent_init">
<span class="target" id="group__memory__api_1ga89d50ed6f233105544e843f0a9987af7"></span><span class="sig-name descname"><span class="n"><span class="pre">coherent_init</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">type</span></span>, <span class="n"><span class="pre">member</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.coherent_init" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate and initialize a coherent shared object with spinlock protection. </p>
<p>Wrapper around <a class="reference internal" href="#group__memory__api_1ga5d989183fe4546948016706d2a946dfc"><span class="std std-ref">__coherent_init()</span></a> computing the member offset and container type size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>type</strong> – <strong>[in]</strong> Type of the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.coherent_shared">
<span class="target" id="group__memory__api_1gaa1ba6aaa13613e21ea5c7097d4d3f47b"></span><span class="sig-name descname"><span class="n"><span class="pre">coherent_shared</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">object</span></span>, <span class="n"><span class="pre">member</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.coherent_shared" title="Link to this definition">#</a><br /></dt>
<dd><p>Mark an allocated coherent object as actively shared across multiple DSP cores. </p>
<p>Wrapper around <a class="reference internal" href="#group__memory__api_1ga1646b10900cf329e24e0f9b0718b084e"><span class="std std-ref">__coherent_shared()</span></a> computing the member address and container size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object</strong> – <strong>[inout]</strong> Pointer to the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.coherent_init_thread">
<span class="target" id="group__memory__api_1ga9e19ed3cbef53202682b77809288528d"></span><span class="sig-name descname"><span class="n"><span class="pre">coherent_init_thread</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">type</span></span>, <span class="n"><span class="pre">member</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.coherent_init_thread" title="Link to this definition">#</a><br /></dt>
<dd><p>Allocate and initialize a coherent shared object with mutex protection for thread context. </p>
<p>Wrapper around <a class="reference internal" href="#group__memory__api_1ga822d8d65dcbf3697f9f1f7d067ce9ea9"><span class="std std-ref">__coherent_init_thread()</span></a> computing the member offset and container type size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>type</strong> – <strong>[in]</strong> Type of the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.coherent_shared_thread">
<span class="target" id="group__memory__api_1gafc0799bfb06a117461dd1307b78b6928"></span><span class="sig-name descname"><span class="n"><span class="pre">coherent_shared_thread</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">object</span></span>, <span class="n"><span class="pre">member</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.coherent_shared_thread" title="Link to this definition">#</a><br /></dt>
<dd><p>Mark a thread-capable coherent object as shared across multiple DSP cores. </p>
<p>Wrapper around <a class="reference internal" href="#group__memory__api_1gac72edfcceb3dce5118544c4a40efdd80"><span class="std std-ref">__coherent_shared_thread()</span></a> computing the member address and container size.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object</strong> – <strong>[inout]</strong> Pointer to the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.coherent_free">
<span class="target" id="group__memory__api_1gacd4722e541102854c60dd9a7cdf4b43c"></span><span class="sig-name descname"><span class="n"><span class="pre">coherent_free</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">object</span></span>, <span class="n"><span class="pre">member</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.coherent_free" title="Link to this definition">#</a><br /></dt>
<dd><p>Invalidate cache and free a coherent shared memory object. </p>
<p>Flushes dirty cache lines back to physical memory and frees the memory block via <a class="reference internal" href="#group__memory__api_1ga76f7b9acb739891ac458864745a444f6"><span class="std std-ref">rfree()</span></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object</strong> – <strong>[inout]</strong> Pointer to the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.coherent_free_thread">
<span class="target" id="group__memory__api_1ga353758adad314dbcd7607299cede4d2d"></span><span class="sig-name descname"><span class="n"><span class="pre">coherent_free_thread</span></span></span><a class="headerlink" href="#c.coherent_free_thread" title="Link to this definition">#</a><br /></dt>
<dd><p>Free a thread-capable coherent shared memory object. </p>
<p>Flushes dirty cache lines back to physical memory and frees the memory block via <a class="reference internal" href="#group__memory__api_1ga76f7b9acb739891ac458864745a444f6"><span class="std std-ref">rfree()</span></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object</strong> – <strong>[inout]</strong> Pointer to the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.is_coherent_shared">
<span class="target" id="group__memory__api_1ga1a09be8245744b796464e9b758d8e163"></span><span class="sig-name descname"><span class="n"><span class="pre">is_coherent_shared</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">object</span></span>, <span class="n"><span class="pre">member</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.is_coherent_shared" title="Link to this definition">#</a><br /></dt>
<dd><p>Query whether a coherent object is configured for multi-core shared mode. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object</strong> – <strong>[in]</strong> Pointer to the container structure. </p></li>
<li><p><strong>member</strong> – <strong>[in]</strong> Member name of the embedded struct coherent. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Non-zero if shared mode is enabled, 0 otherwise. </p>
</dd>
</dl>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.__cold">
<span class="target" id="group__memory__api_1gaf74f8ba1e24b5ef7ab220682dd106e37"></span><span class="sig-name descname"><span class="n"><span class="pre">__cold</span></span></span><a class="headerlink" href="#c.__cold" title="Link to this definition">#</a><br /></dt>
<dd><p>Attribute marking non-latency-critical code for placement in cold memory sections. </p>
<p>Cold code (e.g. initialization, IPC setup, or offload modules) may be placed in DRAM / L3 memory or powered-down banks to conserve high-speed internal SRAM. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.__cold_rodata">
<span class="target" id="group__memory__api_1ga0534c52192b349f1bf7ff74d31082833"></span><span class="sig-name descname"><span class="n"><span class="pre">__cold_rodata</span></span></span><a class="headerlink" href="#c.__cold_rodata" title="Link to this definition">#</a><br /></dt>
<dd><p>Attribute marking read-only constants for placement in cold memory sections. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.dbg_path_hot_start_watching">
<span class="target" id="group__memory__api_1ga39bc981bc8e058cae8bbd92a6cb66f66"></span><span class="sig-name descname"><span class="n"><span class="pre">dbg_path_hot_start_watching</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.dbg_path_hot_start_watching" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.dbg_path_hot_stop_watching">
<span class="target" id="group__memory__api_1ga24273c302aa0b7d9fd27f6156a86b860"></span><span class="sig-name descname"><span class="n"><span class="pre">dbg_path_hot_stop_watching</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.dbg_path_hot_stop_watching" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.dbg_path_hot_confirm">
<span class="target" id="group__memory__api_1ga70657d3504ddf38e4efcecf68047bbb9"></span><span class="sig-name descname"><span class="n"><span class="pre">dbg_path_hot_confirm</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.dbg_path_hot_confirm" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.dbg_path_cold_enter">
<span class="target" id="group__memory__api_1gaa12352fda3a75db1e5b2570dd1eab3af"></span><span class="sig-name descname"><span class="n"><span class="pre">dbg_path_cold_enter</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.dbg_path_cold_enter" title="Link to this definition">#</a><br /></dt>
<dd></dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.assert_can_be_cold">
<span class="target" id="group__memory__api_1gaacb61c0ae2b32823cc255ae0868da36d"></span><span class="sig-name descname"><span class="n"><span class="pre">assert_can_be_cold</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.assert_can_be_cold" title="Link to this definition">#</a><br /></dt>
<dd><p>Assert that the current function is not executing from a latency-critical LL thread. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.VIRTUAL_REGION_SHARED_HEAP_ATTR">
<span class="target" id="group__memory__api_1ga81bbf89a12aac19198c1f3a465d9b825"></span><span class="sig-name descname"><span class="n"><span class="pre">VIRTUAL_REGION_SHARED_HEAP_ATTR</span></span></span><a class="headerlink" href="#c.VIRTUAL_REGION_SHARED_HEAP_ATTR" title="Link to this definition">#</a><br /></dt>
<dd><p>Region attribute for shared virtual memory heap. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR">
<span class="target" id="group__memory__api_1ga065d4674056e20537caac2c9afee7482"></span><span class="sig-name descname"><span class="n"><span class="pre">VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR</span></span></span><a class="headerlink" href="#c.VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR" title="Link to this definition">#</a><br /></dt>
<dd><p>Region attribute for loadable LLEXT libraries. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.VIRTUAL_REGION_VPAGES_ATTR">
<span class="target" id="group__memory__api_1ga384b36c3acffe541a5abd12207699ad5"></span><span class="sig-name descname"><span class="n"><span class="pre">VIRTUAL_REGION_VPAGES_ATTR</span></span></span><a class="headerlink" href="#c.VIRTUAL_REGION_VPAGES_ATTR" title="Link to this definition">#</a><br /></dt>
<dd><p>Region attribute for virtual page allocator. </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.MAX_MEMORY_ALLOCATORS_COUNT">
<span class="target" id="group__memory__api_1ga0df8e3df0d86ca4ed2785587c920ae25"></span><span class="sig-name descname"><span class="n"><span class="pre">MAX_MEMORY_ALLOCATORS_COUNT</span></span></span><a class="headerlink" href="#c.MAX_MEMORY_ALLOCATORS_COUNT" title="Link to this definition">#</a><br /></dt>
<dd><p>Maximum amount of memory block allocators in one heap. </p>
<p>Since minimum realistic block is cache line size and block sizes must be powers of 2 (e.g. 64, 128, 256, 512, 1024, 2048, 4096, 8192). </p>
</dd></dl>
<dl class="c macro">
<dt class="sig sig-object c" id="c.DEFAULT_CONFIG_ALOCATORS_COUNT">
<span class="target" id="group__memory__api_1gac229a44bae8a109145f534f7b1ba313c"></span><span class="sig-name descname"><span class="n"><span class="pre">DEFAULT_CONFIG_ALOCATORS_COUNT</span></span></span><a class="headerlink" href="#c.DEFAULT_CONFIG_ALOCATORS_COUNT" title="Link to this definition">#</a><br /></dt>
<dd><p>Default number of power-of-2 block allocators partitioned across a region. </p>
</dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-enums">Enums</p>
<dl class="c enum">
<dt class="sig sig-object c" id="c.vregion_mem_type">
<span class="target" id="group__memory__api_1ga3240f48eb07fb2c64623f7c1d6e4c9a0"></span><span class="k"><span class="pre">enum</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">vregion_mem_type</span></span></span><a class="headerlink" href="#c.vregion_mem_type" title="Link to this definition">#</a><br /></dt>
<dd><p>Memory allocation modes within a virtual memory region. </p>
<p>Distinguishes lifetime allocations (bound to pipeline topology, cannot be freed until teardown) from interim allocations (dynamically created and released during runtime operations). </p>
<p><em>Values:</em></p>
<dl class="c enumerator">
<dt class="sig sig-object c" id="c.vregion_mem_type.VREGION_MEM_TYPE_INTERIM">
<span class="target" id="group__memory__api_1gga3240f48eb07fb2c64623f7c1d6e4c9a0ac0a09f0d087ff461adb9dc35a8db94a3"></span><span class="k"><span class="pre">enumerator</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">VREGION_MEM_TYPE_INTERIM</span></span></span><a class="headerlink" href="#c.vregion_mem_type.VREGION_MEM_TYPE_INTERIM" title="Link to this definition">#</a><br /></dt>
<dd><p>Interim allocation that can be freed dynamically (e.g. </p>
<p>large config set/get, controls). </p>