Он вызывает файлы, включенные в этот конкретный пакет, который объявлен внутри класса BundleConfig
в папке App_Start
.
В этом конкретном случае вызов @Styles.Render("~/Content/css")
вызывает "~ / Content / site.css".
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
By the way, string interning is completely unrelated to that. The rule for passing parameters to functions is the same for all reference types (and really, all types), no matter how they are managed internally.
The rule is simple and you have stated it correctly: pass by value copies the reference, not the target. No heap space is copied here.
При передаче объектов ByVal создается копия указателя , а не сам объект. Вот демонстрация:
Module Module1
Dim original As String = "Hello world"
Sub PassByReferenceTest(ByVal other As String)
Console.WriteLine("object.ReferenceEquals(original, other): {0}", _
Object.ReferenceEquals(original, other))
End Sub
Sub Main()
PassByReferenceTest(original)
Console.ReadKey(True)
End Sub
End Module
Эта программа выводит следующее:
object.ReferenceEquals(original, other): True
Итак, исходная строка и строка, которую мы передали по значению, существуют по одному и тому же адресу в адресе памяти. Вы не делаете копию самой строки.
Is short, no. It passes a ref to the string. Only one instance of the string itself.
No. it still uses the copy of the reference to the "Blah".
What makes you think, it will?
On a side note, string are interned.
string s = "hello";
string t = "hello";
s & t both refer to the same string (because it is interned). If you modify s or t, it will create a new string, then.
строка является ссылочным типом. Если вы передаете его по значению, то вы передаете значение ссылки.
Единственный способ получить еще одну копию в куче - это изменить значение переменной.